package org.huangrui.javase.collectionMap.map;

import org.junit.Test;

import java.util.HashMap;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.TreeMap;

/**
 * @Author hr
 * @Create 2025-11-07 17:07
 **/
public class T02Map {
    @Test
    public void test1(){
        HashMap<Integer,String> map = new HashMap<>();
        map.put(111,"hello");
        map.put(888,"java");
        map.put(666,"atguigu");
        map.put(null,null);
        System.out.println(map);
    }

    @Test
    public void test2(){
        LinkedHashMap<Integer,String> map = new LinkedHashMap<>();
        map.put(111,"hello");
        map.put(888,"java");
        map.put(666,"atguigu");
        map.put(null,null);
        System.out.println(map);
    }

    @Test
    public void test3(){
        TreeMap<Integer,String> map = new TreeMap<>();
        map.put(111,"hello");
        map.put(888,"java");
        map.put(666,"atguigu");
         // map.put(null,null);
        System.out.println(map);
    }

    @Test
    public void test4(){
        Hashtable<Integer,String> map = new Hashtable<>();
        map.put(111,"hello");
        map.put(888,"java");
        map.put(666,"atguigu");
        // map.put(null,null);
        System.out.println(map);
    }
}
